<extend name="Include:Layout"/>
<block name="title">服务</block>
<block name="style">
<style>

</style>
</block>

<block name="main">
	<div class="weui_tab">
		<div class="weui_tab_bd container" id="container">
		
		</div>
		<php>$curbar = 3;</php>
    	<include file="Include:navbar" />
    </div>

<script type="text/html" id="tpl_home">
	这是首页
</script>    
<script type="text/html" id="tpl_kecheng">
	这是课程
</script>
<script type="text/html" id="tpl_fuwu">
	这是服务
</script>
<script type="text/html" id="tpl_my">

</script>
</block>

<block name="script">
<script>
$(function () {
	
	$('.weui_tabbar_item').click(function(){
		var $this = $(this);
		if(!$this.hasClass('weui_bar_item_on')){
			$('.weui_bar_item_on').removeClass('weui_bar_item_on');
			$this.addClass('weui_bar_item_on');
		}
	});
	
    var router = new Router({
        container: '#container',
        enterTimeout: 250,
        leaveTimeout: 250
    });
    
 	// grid
    var home = {
        url: '/',
        className: 'home',
        render: function () {
            return $('#tpl_home').html();
        }
    };

    // button
    var kecheng = {
        url: '/kecheng',
        className: 'kecheng',
        render: function () {
            return $('#tpl_kecheng').html();
        }
    };
    
    var fuwu = {
            url: '/fuwu',
            className: 'fuwu',
            render: function () {
                return $('#tpl_fuwu').html();
            }
        };
    
    var my = {
            url: '/my',
            className: 'my',
            render: function () {
                return $('#tpl_my').html();
            }
        };
    /*
    router.push(home)
    .push(home)
    .push(kecheng)
    .push(fuwu)
    .push(my)
    .setDefault('/')
    .init();
	*/
	if (/Android/gi.test(navigator.userAgent)) {
	    window.addEventListener('resize', function () {
	        if (document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA') {
	            window.setTimeout(function () {
	                document.activeElement.scrollIntoViewIfNeeded();
	            }, 0);
	        }
	    })
	}
});
</script>
</block>